import 'package:equatable/equatable.dart';
import 'package:backend.core/core/domain/entities/api/app_store/api_app_store_transaction_offer_type.dart';
import 'package:backend.core/core/domain/entities/api/app_store/api_app_store_transaction_ownership_type.dart';
import 'package:backend.core/core/domain/entities/api/app_store/api_app_store_transaction_revocation_info.dart';

class ApiAppStorePurchasedSubscriptionTransaction extends Equatable {
  const ApiAppStorePurchasedSubscriptionTransaction({
    required this.id,
    required this.time,
    required this.originalTransactionId,
    required this.offerType,
    required this.ownershipType,
    required this.revocationInfo,
    required this.expirationTime,
  });

  final String id;
  final DateTime time;
  final String originalTransactionId;
  final ApiAppStoreTransactionOfferType offerType;
  final ApiAppStoreTransactionOwnershipType ownershipType;
  final ApiAppStoreTransactionRevocationInfo? revocationInfo;
  final DateTime expirationTime;

  @override
  List<Object?> get props {
    return [
      id,
      time,
      originalTransactionId,
      offerType,
      ownershipType,
      revocationInfo,
      expirationTime,
    ];
  }
}
